<template>
  <div>
    <my-header :title="'排行榜'"></my-header>
    <my-list :list="movieList" class="movie-list"/>
  </div>
</template>
<script>
import MyHeader from 'common/header/Header'
import MyList from 'common/List'
import axios from 'axios'
export default {
  name: 'Top',
  components: {
    MyHeader,
    MyList
  },
  data () {
    return {
      movieList: []
    }
  },
  methods: {
    getMovieList () {
      axios.get('/api/allClass').then(this.getListSucc)
    },
    getListSucc (res) {
      res = res.data
      this.movieList = res.data.movieList
    },
    toggleSideBar () {
      this.SideBar = !this.SideBar
      this.UserBox = false
    },
    toggleUserBox () {
      this.UserBox = !this.UserBox
      this.SideBar = false
    }
  },
  mounted () {
    this.getMovieList()
  }
}
</script>
<style lang="stylus" scoped>
  .movie-list
    margin-top: .6rem
</style>
